{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 衡量回归算法标准"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import datasets"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 波士顿房产数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "boston = datasets.load_boston()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = boston.data[:,5] # 房间数量特征"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(506,)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "y = boston.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2df5AcZ5nfv8+O2tasCR7JLMQeW8hcKAl0Qlq8hZVTFXUSF+vA2Gz8E8dQVIqK8weVYHDtIVIEy1dOLKIQ+/5IkXJB7nxlzsiWYbFxgrjCulzFVTYneS18iq3KgW2ZkYIF1hqQxvLs7pM/Zno0M9tv99s9/Xu+nyrVaudH99M9O99++3m+7/OKqoIQQkgxGcs6AEIIIdGhiBNCSIGhiBNC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wgG8BgKq+parz2UaVOB8B8DNVzfus6KisAFAVkRVoX5CPZxxPErwPwNOqekZVFwD8LwD/3O8NFPFz3AfgTwAsZR1ICiiAH4nIIRG5LetgEuI9AE4C+PNOiuybInJB1kElzCcBPJR1EEmgqg0A/xnAMQAnALyhqj/KNqpE+HsAHxaRi0RkHMDHAFzm9waKOAAR+TiA11T1UNaxpMRWVf0ggI8C+JyIfDjrgBJgBYAPAviGqk4COA1gZ7YhJUcnXXQtgEeyjiUJRGQVgE8AuBzAJQAuEJFPZRtV/KjqCwC+BuCvAfwQwGEAC37voYi32QrgWhF5GcB3AGwXkQezDSk5VPV45+draOdPP5RtRInwCwC/UNVnOr/vQ1vUy8pHATyrqr/MOpCE+CMAL6nqSVVtAfgugD/IOKZEUNVvqeoHVfXDAF4HYMyHAxRxAICqfllVL1XVtWjfkj6pqqW7ygOAiFwgIv/I/T+Aq9C+hSsVqvr/ALwqIus6D30EwP/JMKSkuQUlTaV0OAZgi4iMi4ig/Xm+kHFMiSAi7+z8XAPgOgR8rnSnjB7vAvC99vcAKwD8lar+MNuQEuPfAPh2J9XwcwD/MuN4EqGTO/1nAP511rEkhao+IyL7ADyLdnphDuWdfv+oiFwEoAXgc6p6yu/FnHZPCCEFhukUQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMBRxQggpMP8fVR4GbRtSaO8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 清理数据集的最大值\n",
    "x = x[y < 50.0]\n",
    "y = y[y < 50.0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX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U5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x,y)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def train_test_split(X, y, test_ratio=0.2, seed=None):\n",
    "    \"\"\"将数据 X 和 y 按照test_ratio分割成X_train, X_test, y_train, y_test\"\"\"\n",
    "    assert X.shape[0] == y.shape[0], \\\n",
    "        \"the size of X must be equal to the size of y\"\n",
    "    assert 0.0 <= test_ratio <= 1.0, \\\n",
    "        \"test_ration must be valid\"\n",
    "\n",
    "    if seed:\n",
    "        np.random.seed(seed)\n",
    "\n",
    "    shuffled_indexes = np.random.permutation(len(X))\n",
    "\n",
    "    test_size = int(len(X) * test_ratio)\n",
    "    test_indexes = shuffled_indexes[:test_size]\n",
    "    train_indexes = shuffled_indexes[test_size:]\n",
    "\n",
    "    X_train = X[train_indexes]\n",
    "    y_train = y[train_indexes]\n",
    "\n",
    "    X_test = X[test_indexes]\n",
    "    y_test = y[test_indexes]\n",
    "\n",
    "    return X_train, X_test, y_train, y_test\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_train, x_test, y_train,y_test = train_test_split(x,y,seed=1218)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(392,)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "class SimpleLinearRegression:\n",
    "    def __init__(self):\n",
    "        self.a_ = None\n",
    "        self.b_ = None\n",
    "    def fit(self,x_train,y_train):\n",
    "        x_mean = np.mean(x_train)\n",
    "        y_mean = np.mean(y_train)\n",
    "        num = (x_train - x_mean).dot(y_train - y_mean)\n",
    "        d = (x_train - x_mean).dot(x_train - x_mean)\n",
    "        self.a_ = num/d\n",
    "        self.b_ = y_mean - self.a_ * x_mean\n",
    "        return self\n",
    "    def _predict(self,x_single):\n",
    "        return self.a_ * x_single + self.b_\n",
    "    \n",
    "    def predict(self, x_predict):\n",
    "        return np.array([self._predict(x) for x in x_predict])\n",
    "    \n",
    "    def __repr__(self):\n",
    "        return \"SimpleLinearRegression()\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "SimpleLinearRegression()"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg = SimpleLinearRegression()\n",
    "reg.fit(x_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "8.030433463838792"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg.a_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-28.570226604208827"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "reg.b_"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAD4CAYAAAAaT9YAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO2deZwU1bn3v2eGFgc0DCgqjuCgUVTkVWDcXuKCGHmTqExwId64JG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GDhOa92hlHoSo4fBn/M6MY9RSh0PXIvRw3gv8KxSapnW+m2nY8QSj6CUOgz4FjAr33MRskcp9RXgDGA2gNZ6r9a6Lb+z8p1xwLta60LPis6UXkCFUqoXxgO5GDuJHQus0Vq3a607gReAbyc7QEQ8xgzgVqA73xPJARp4TinVFGlkXYwcAewC5kRcZLOUUn3zPSmf+Q4wL9+T8AOtdStwL7AV2AHs0Vo/l99Z+cKbwBlKqQOUUn2AbxLfBrMHIuKAUuo8YKfWuinfc8kRY7TWo4BvADcqpc7I94R8oBcwCnhIaz0S+ByYkt8p+UfEXXQBUJQdxZVS/YEJwFDgUKCvUuqy/M7Ke7TW64G7gRXAs8A6oDPZMSLiBmOAC5RSm4EngLOVUo/ld0r+obXeHvlzJ4b/9OT8zsgX3gfe11q/EtleiCHqxco3gL9rrT/M90R84hxgk9Z6l9Y6DCwG/m+e5+QLWuvZWutRWuszgI8BR384iIgDoLWeqrU+TGtdjfFKukprXXRPeQClVF+l1P7m34FzMV7higqt9QfANqXUsMjQOOCtPE7Jby6lSF0pEbYCpyql+iilFMb9XJ/nOfmCUuqgyJ9DgImkuK8SnVJ6HAw8Zfx/QC/gL1rrZ/M7Jd/4EfB4xNXwHvD9PM/HFyK+068DP8j3XPxCa/2KUmoh8HcM90IzxZt+v0gpdQAQBm7UWu9OtrOk3QuCIAQYcacIgiAEGBFxQRCEACMiLgiCEGBExAVBEAKMiLggCEKAEREXBEEIMCLigiAIAeb/A+dSa2dMp0K/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(x_train,y_train)\n",
    "plt.plot(x_train,reg.predict(x_train),color='r')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_predict = reg.predict(x_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### MSE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28.627911494718404"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mse_test = np.sum((y_predict - y_test) ** 2)/len(y_test)\n",
    "mse_test"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### RMSE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5.350505723267513"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from math import sqrt\n",
    "rmse_test = sqrt(mse_test)\n",
    "rmse_test #rmse平误差5万美元"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### MAE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.9867227812289623"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mae_test = np.sum(np.absolute(y_predict - y_test))/len(y_test)\n",
    "mae_test # mae 平均误差"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# sklearn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.metrics import mean_absolute_error"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28.627911494718404"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_squared_error(y_test,y_predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.9867227812289623"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_absolute_error(y_test,y_predict)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## R Square"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.5023966539653258"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean_squared_error(y_test,y_predict) / np.var(y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* <span style=\"color:#F00\">具体的公示要写一下,去视频里边找<span>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
